<?php
// ~ $link = mysqli_connect($host, $userbase, $passwd) or die('Impossible de se connecter pour récupérer niveau : ' . mysql_error());
mysql_select_db ( $db ) or die ( 'Impossible de s&#233;lectionner la base de donn&#233;es' );
// ~ mysqli_select_db($link,$db) or die('Impossible de s&#233;lectionner la base de donn&#233;es');

if ($table == 'diagnostic') {
	$query_deleteform = "DELETE FROM `spatax`.`$table` WHERE `diagnostic`.`form` = " . $form;
	mysql_query ( $query_deleteform );
	// ~ mysqli_query($link,$query_deleteform);
	
	$query_deletesara = "DELETE FROM `spatax`.`sara` WHERE `sara`.`form` = " . $form;
	mysql_query ( $query_deletesara );
	// ~ mysqli_query($link,$query_deletesara);
	
	$query_deletesprs = "DELETE FROM `spatax`.`sprs` WHERE `sprs`.`form` = " . $form;
	mysql_query ( $query_deletesprs );
	// ~ mysqli_query($link,$query_deletesprs);
} else {
	$query_delete = "DELETE FROM `spatax`.`$table` WHERE `$table`.`index` = " . $form;
	mysql_query ( $query_delete );
	// ~ mysqli_query($link,$query_delete);
}

?>
